﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ExceptionsProcessReport.aspx.cs" Inherits="MLY.LTR.ExceptionsProcessReport" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Process Report</title>
    <style type="text/css">
        .TitleStyle
        {
            font-family:Arial Sans-Serif David;
            font-size:14px;
            color:Black;
        }
        .InerTextStyle
        {
            font-family:Arial Sans-Serif David;
            font-size:12px;
            color:Black;
        }
    </style>
</head>
<body>    
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="Report1UpdatePanel" runat="server" UpdateMode="Conditional">
        <ContentTemplate>        
        <table style="width:100%;">
        <tr>
        <td style="vertical-align:top; width:15%;">
            <div  style="direction:rtl;">
            <asp:Label ID="Report1TitleLabel" runat="server"
             Text="ממתין לSCD (רכש) להזמנת אפס" CssClass="TitleStyle"></asp:Label>
             
            <br />
            <asp:Label ID="DaysWait1Label" runat="server" Text="ימי המתנה" CssClass="TitleStyle"></asp:Label>
            <asp:DropDownList ID="Report1paramDDL" runat="server" AutoPostBack="true" OnSelectedIndexChanged="UpdateReport1">
                <asp:ListItem Value="0">הכל</asp:ListItem>
                <asp:ListItem Value="1">יום אחד</asp:ListItem>
                <asp:ListItem Value="2">יומיים</asp:ListItem>
                <asp:ListItem Value="3" Selected="True">3 ימים</asp:ListItem>
                <asp:ListItem Value="4">4 ימים</asp:ListItem>
                <asp:ListItem Value="5">5 ימים</asp:ListItem>
                <asp:ListItem Value="6">6 ימים</asp:ListItem>
                <asp:ListItem Value="7">7 ימים</asp:ListItem>
                <asp:ListItem Value="8">8 ימים</asp:ListItem>
                <asp:ListItem Value="9">9 ימים</asp:ListItem>
                <asp:ListItem Value="10">10 ימים</asp:ListItem>
                <asp:ListItem Value="11">11 ימים</asp:ListItem>
                <asp:ListItem Value="12">12 ימים</asp:ListItem>
                <asp:ListItem Value="13">13 ימים</asp:ListItem>
                <asp:ListItem Value="14">14 ימים</asp:ListItem>
                <asp:ListItem Value="15">15 ימים</asp:ListItem>
                <asp:ListItem Value="16">16 ימים</asp:ListItem>
                <asp:ListItem Value="17">17 ימים</asp:ListItem>
                <asp:ListItem Value="18">18 ימים</asp:ListItem>
                <asp:ListItem Value="19">19 ימים</asp:ListItem>
                <asp:ListItem Value="20">20 ימים</asp:ListItem>
            </asp:DropDownList>
            <br /><br />
            <asp:DropDownList ID="Report1YNDDL" runat="server" AutoPostBack="true" OnSelectedIndexChanged="UpdateReport1">
                <asp:ListItem Text="Not including NO" Selected="True" Value="1"></asp:ListItem>
                <asp:ListItem Text="Including NO" Value="2"></asp:ListItem>
            </asp:DropDownList>
            <br /><br />
            <asp:ImageButton ID="ExportToExcel1" runat="server" ImageUrl="~/Images/excel.gif" OnClick="ExportToExcel" />
            </div>
            <asp:UpdateProgress ID="Report1UpdateProgress" runat="server" AssociatedUpdatePanelID="Report1UpdatePanel">
            <ProgressTemplate>
                <asp:Label ID="Report1ProgresLabel" runat="server" Text="Loading..." CssClass="InerTextStyle"></asp:Label>
            </ProgressTemplate>
            </asp:UpdateProgress>
            
        </td>
        <td style="width:85%;">
            <div class="InerTextStyle">
            <asp:GridView ID="Report1GridView" runat="server" AutoGenerateColumns="false" AllowPaging="false" 
            DataSourceID="Report1DataSource">
            <Columns>
                <asp:BoundField DataField="CustomerWorkOrderNumber" HeaderText="Work order number" 
                HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%" />
                <asp:BoundField DataField="ContractorWorkOrderNumber" ItemStyle-Width="7%"
                 HeaderText="Contractor Order Number" HeaderStyle-BackColor="#86C2FF"/>
                 <asp:BoundField DataField="CustomerCatalougeCode" HeaderText="Customer catalogue code" 
                HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%" />
                <asp:TemplateField HeaderText="Time In Station" ItemStyle-Width="7%">
                <HeaderStyle BackColor="#86C2FF" />
                <ItemTemplate>
                <%# CalculateTimeSince(Eval("PlannedDelivaryDate"))%>
                </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Days overdue" ItemStyle-Width="7%" >
                <HeaderStyle BackColor="#86C2FF" />
                <ItemTemplate>
                <%# CalculateOverdueTime(Eval("PlannedDelivaryDate"), "1")%>
                </ItemTemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Send Date" ItemStyle-Width="7%" >
                <HeaderStyle BackColor="#86C2FF" />
                <ItemTemplate>
                <%# FormatDate(Eval("SendDate")) %>
                </ItemTemplate>               
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Requested delivery date" ItemStyle-Width="7%" >
                <HeaderStyle BackColor="#86C2FF" />
                <ItemTemplate>
                <%# FormatDate(Eval("RequestedDelivaryDate"))%>                
                </ItemTemplate>                
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Planned delivery date" ItemStyle-Width="7%" >
                <HeaderStyle BackColor="#86C2FF" />
                <ItemTemplate>
                <%# FormatDate(Eval("PlannedDelivaryDate"))%>
                </ItemTemplate>                
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Actual delivery date" ItemStyle-Width="7%" >
                <HeaderStyle BackColor="#86C2FF" />
                <ItemTemplate>
                <%# FormatDate(Eval("ActualDelivaryDate"))%>
                </ItemTemplate>                
                </asp:TemplateField>
                
                <asp:BoundField DataField="OrderNumber" HeaderText="Contractor order number" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%"  />
                <asp:BoundField DataField="TextFieldA" HeaderText="Customer Service Manager" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%"  />
                <asp:BoundField DataField="TextFieldB" HeaderText="$" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%"  />
                <asp:BoundField DataField="TextFieldC" HeaderText="<%$ Dict:TextFieldC %>" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%"  />
                
                <asp:TemplateField HeaderText="Supplier Approval" ItemStyle-Width="6%">
                <HeaderStyle BackColor="#86C2FF" />
                <ItemTemplate>
                <%# FormatDate(Eval("DateFieldA"))%>
                </ItemTemplate>                
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Customer Approval" ItemStyle-Width="6%">
                <HeaderStyle BackColor="#86C2FF" />
                <ItemTemplate>
                <%# FormatDate(Eval("DateFieldB"))%>
                </ItemTemplate>
                </asp:TemplateField>
                
            </Columns>
            </asp:GridView>
            </div>
        </td>
        </tr>  
        </table>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="ExportToExcel1" />
        </Triggers>
        </asp:UpdatePanel> 
        <br />
        <br /> 
        <asp:UpdatePanel ID="Report2UpdatePanel" runat="server" UpdateMode="Conditional">
        <ContentTemplate>        
        <table style="width:100%;">
        <tr>
        <td style="vertical-align:top; width:15%;" >
            <div  style="direction:rtl;">
            <asp:Label ID="Report2TitleLabel" runat="server" Text="ממתין לריקור להצעת מחיר" CssClass="TitleStyle"></asp:Label>
            <br />
            <asp:Label ID="Report2ParamTitleLabel" runat="server" Text="ימי המתנה" CssClass="TitleStyle"></asp:Label>
            <asp:DropDownList ID="Report2paramDDL" runat="server" AutoPostBack="true" OnSelectedIndexChanged="UpdateReport2">
                <asp:ListItem Value="0">הכל</asp:ListItem>
                <asp:ListItem Value="1">יום אחד</asp:ListItem>
                <asp:ListItem Value="2">יומיים</asp:ListItem>
                <asp:ListItem Value="3">3 ימים</asp:ListItem>
                <asp:ListItem Value="4">4 ימים</asp:ListItem>
                <asp:ListItem Value="5">5 ימים</asp:ListItem>
                <asp:ListItem Value="6">6 ימים</asp:ListItem>
                <asp:ListItem Value="7">7 ימים</asp:ListItem>
                <asp:ListItem Value="8">8 ימים</asp:ListItem>
                <asp:ListItem Value="9">9 ימים</asp:ListItem>
                <asp:ListItem Value="10" Selected="True">10 ימים</asp:ListItem>
                <asp:ListItem Value="11">11 ימים</asp:ListItem>
                <asp:ListItem Value="12">12 ימים</asp:ListItem>
                <asp:ListItem Value="13">13 ימים</asp:ListItem>
                <asp:ListItem Value="14">14 ימים</asp:ListItem>
                <asp:ListItem Value="15">15 ימים</asp:ListItem>
                <asp:ListItem Value="16">16 ימים</asp:ListItem>
                <asp:ListItem Value="17">17 ימים</asp:ListItem>
                <asp:ListItem Value="18">18 ימים</asp:ListItem>
                <asp:ListItem Value="19">19 ימים</asp:ListItem>
                <asp:ListItem Value="20">20 ימים</asp:ListItem>
            </asp:DropDownList>
            <br /><br />
            <asp:DropDownList ID="Report2YNDDL" runat="server" AutoPostBack="true" OnSelectedIndexChanged="UpdateReport2">
                <asp:ListItem Text="Not including NO" Selected="True" Value="1"></asp:ListItem>
                <asp:ListItem Text="Including NO" Value="2"></asp:ListItem>
            </asp:DropDownList>
            <br /><br />
            <asp:ImageButton ID="ExportToExcel2" runat="server" ImageUrl="~/Images/excel.gif" OnClick="ExportToExcel" />
            
            </div>
            <asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="Report2UpdatePanel">
            <ProgressTemplate>
                <asp:Label ID="Report2ProgresLabel" runat="server" Text="Loading..." CssClass="InerTextStyle"></asp:Label>
            </ProgressTemplate>
            </asp:UpdateProgress>
        </td>
        <td style="width:85%;">
            <div class="InerTextStyle">
            <asp:GridView ID="Report2GridView" runat="server" AutoGenerateColumns="false" AllowPaging="false" DataSourceID="Report2DataSource">
            <Columns>
                <asp:BoundField DataField="CustomerWorkOrderNumber" HeaderText="Work order number"
                HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%"  />
                <asp:BoundField DataField="ContractorWorkOrderNumber" HeaderText="Contractor Order Number"
                HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%"  />
                <asp:BoundField DataField="CustomerCatalougeCode" HeaderText="Customer catalogue code" 
                HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%" />
                <asp:TemplateField HeaderText="Time In Station" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%" >
                <ItemTemplate>
                <%# CalculateTimeSince(Eval("SendDate")) %>
                </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Days overdue" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%" >
                <ItemTemplate>
                <%# CalculateOverdueTime(Eval("SendDate"), "2")%>
                </ItemTemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Send Date" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                <ItemTemplate>
                <%# FormatDate(Eval("SendDate")) %>
                </ItemTemplate>               
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Requested delivery date" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                <ItemTemplate>
                <%# FormatDate(Eval("RequestedDelivaryDate"))%>
                </ItemTemplate>                
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Planned delivery date" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                <ItemTemplate>
                <%# FormatDate(Eval("PlannedDelivaryDate"))%>
                </ItemTemplate>                
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Actual delivery date" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                <ItemTemplate>
                <%# FormatDate(Eval("ActualDelivaryDate"))%>
                </ItemTemplate>                
                </asp:TemplateField>
                
                <asp:BoundField DataField="OrderNumber" HeaderText="Contractor order number" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%" />
                <asp:BoundField DataField="TextFieldA" HeaderText="Customer Service Manager" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%" />
                <asp:BoundField DataField="TextFieldB" HeaderText="$" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%" />
                <asp:BoundField DataField="TextFieldC" HeaderText="<%$ Dict:TextFieldC %>" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%"  />
                
                <asp:TemplateField HeaderText="Supplier Approval" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%">
                <ItemTemplate>
                <%# FormatDate(Eval("DateFieldA"))%>
                </ItemTemplate>                
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Customer Approval" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%">
                <ItemTemplate>
                <%# FormatDate(Eval("DateFieldB"))%>
                </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            </asp:GridView>
            </div>
        </td>
        </tr>  
        </table>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="ExportToExcel2" />
        </Triggers>
        </asp:UpdatePanel> 
        <br />
        <br />
        <asp:UpdatePanel ID="Report3Updatepanel" runat="server" UpdateMode="Conditional">
        <ContentTemplate>        
        <table style="width:100%;">
        <tr>
        <td style="vertical-align:top; width:15%;" >
            <div  style="direction:rtl;">
            <asp:Label ID="Report3TitleLabel" runat="server"
             Text="ממתין לאישור שירות לקוחות בSCD" CssClass="TitleStyle"></asp:Label>            
            <br />
            <asp:Label ID="Report3DateTitleLabel" runat="server" Text="ימי המתנה" CssClass="TitleStyle"></asp:Label>
            <asp:DropDownList ID="Report3paramDDL" runat="server" AutoPostBack="true" OnSelectedIndexChanged="UpdateReport3">
                <asp:ListItem Value="0">הכל</asp:ListItem>
                <asp:ListItem Value="1">יום אחד</asp:ListItem>
                <asp:ListItem Value="2">יומיים</asp:ListItem>
                <asp:ListItem Value="3">3 ימים</asp:ListItem>
                <asp:ListItem Value="4">4 ימים</asp:ListItem>
                <asp:ListItem Value="5" Selected="True">5 ימים</asp:ListItem>
                <asp:ListItem Value="6">6 ימים</asp:ListItem>
                <asp:ListItem Value="7">7 ימים</asp:ListItem>
                <asp:ListItem Value="8">8 ימים</asp:ListItem>
                <asp:ListItem Value="9">9 ימים</asp:ListItem>
                <asp:ListItem Value="10">10 ימים</asp:ListItem>
                <asp:ListItem Value="11">11 ימים</asp:ListItem>
                <asp:ListItem Value="12">12 ימים</asp:ListItem>
                <asp:ListItem Value="13">13 ימים</asp:ListItem>
                <asp:ListItem Value="14">14 ימים</asp:ListItem>
                <asp:ListItem Value="15">15 ימים</asp:ListItem>
                <asp:ListItem Value="16">16 ימים</asp:ListItem>
                <asp:ListItem Value="17">17 ימים</asp:ListItem>
                <asp:ListItem Value="18">18 ימים</asp:ListItem>
                <asp:ListItem Value="19">19 ימים</asp:ListItem>
                <asp:ListItem Value="20">20 ימים</asp:ListItem>
            </asp:DropDownList>
            <br /><br />
            <asp:DropDownList ID="Report3YNDDL" runat="server" AutoPostBack="true" OnSelectedIndexChanged="UpdateReport3">
                <asp:ListItem Text="Not including NO" Selected="True" Value="1"></asp:ListItem>
                <asp:ListItem Text="Including NO" Value="2"></asp:ListItem>
            </asp:DropDownList>
            <br /><br />
            <asp:ImageButton ID="ExportToExcel3" runat="server" ImageUrl="~/Images/excel.gif" OnClick="ExportToExcel" />
            </div>
            <asp:UpdateProgress ID="Report3UpdateProgress" runat="server" AssociatedUpdatePanelID="Report3UpdatePanel">
            <ProgressTemplate>
                <asp:Label ID="Report3ProgresLabel" runat="server" Text="Loading..." CssClass="InerTextStyle"></asp:Label>
            </ProgressTemplate>
            </asp:UpdateProgress>
        </td>
        <td style="width:85%;">
            <div class="InerTextStyle">
            <asp:GridView ID="Report3GridView" runat="server" AutoGenerateColumns="false" AllowPaging="false" DataSourceID="Report3DataSource">
            <Columns>
                <asp:BoundField DataField="CustomerWorkOrderNumber" HeaderText="Work order number" 
                HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%" />
                <asp:BoundField DataField="ContractorWorkOrderNumber" HeaderText="Contractor Order Number" 
                 HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%"/>
                <asp:BoundField DataField="CustomerCatalougeCode" HeaderText="Customer catalogue code" 
                HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%" />
                <asp:TemplateField HeaderText="Time In Station" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                <ItemTemplate>
                <%# CalculateTimeSince(Eval("PlannedDelivaryDate"), Eval("DateFieldB"), Eval("SendDate"))%>
                </ItemTemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Days overdue" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                <ItemTemplate>
                <%# CalculateOverdueTime(Eval("PlannedDelivaryDate"), Eval("DateFieldB"), Eval("SendDate"), "3")%>
                </ItemTemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Send Date" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                <ItemTemplate>
                <%# FormatDate(Eval("SendDate")) %>
                </ItemTemplate>               
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Requested delivery date" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                <ItemTemplate>
                <%# FormatDate(Eval("RequestedDelivaryDate"))%>
                </ItemTemplate>                
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Planned delivery date" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                <ItemTemplate>
                <%# FormatDate(Eval("PlannedDelivaryDate"))%>
                </ItemTemplate>                
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Actual delivery date" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                <ItemTemplate>
                <%# FormatDate(Eval("ActualDelivaryDate"))%>
                </ItemTemplate>                
                </asp:TemplateField>
                
                <asp:BoundField DataField="OrderNumber" HeaderText="Contractor order number"
                 HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%" />
                <asp:BoundField DataField="TextFieldA" HeaderText="Customer Service Manager"
                 HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%" />
                <asp:BoundField DataField="TextFieldB" HeaderText="$"
                 HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%" />
                 <asp:BoundField DataField="TextFieldC" HeaderText="<%$ Dict:TextFieldC %>" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%"  />
                
                <asp:TemplateField HeaderText="Supplier Approval" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%">
                <ItemTemplate>
                <%# FormatDate(Eval("DateFieldA"))%>
                </ItemTemplate>                
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Customer Approval" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%">
                <ItemTemplate>
                <%# FormatDate(Eval("DateFieldB"))%>
                </ItemTemplate>
                </asp:TemplateField>
                
            </Columns>
            </asp:GridView>
            </div>
        </td>
        </tr>  
        </table>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="ExportToExcel3" />
        </Triggers>
        </asp:UpdatePanel> 
        <br />
        <br />
        <asp:UpdatePanel ID="Report4Updatepanel" runat="server" UpdateMode="Conditional">
        <ContentTemplate>        
        <table style="width:100%;">
        <tr>
        <td style="vertical-align:top; width:15%;" >
            <div  style="direction:rtl;">
            <asp:Label ID="Report4TitleLabel" runat="server" Text=" ממתין להכנסת הזמנה בכסף של SCD." CssClass="TitleStyle"></asp:Label>
            
            <br />
            <asp:Label ID="Report4ParamTitleLabel" runat="server" Text="ימי המתנה" CssClass="TitleStyle"></asp:Label>
            <asp:DropDownList ID="Report4paramDDL" runat="server" AutoPostBack="true" OnSelectedIndexChanged="UpdateReport4">
                <asp:ListItem Value="0">הכל</asp:ListItem>
                <asp:ListItem Value="1">יום אחד</asp:ListItem>
                <asp:ListItem Value="2">יומיים</asp:ListItem>
                <asp:ListItem Value="3" Selected="True">3 ימים</asp:ListItem>
                <asp:ListItem Value="4">4 ימים</asp:ListItem>
                <asp:ListItem Value="5">5 ימים</asp:ListItem>
                <asp:ListItem Value="6">6 ימים</asp:ListItem>
                <asp:ListItem Value="7">7 ימים</asp:ListItem>
                <asp:ListItem Value="8">8 ימים</asp:ListItem>
                <asp:ListItem Value="9">9 ימים</asp:ListItem>
                <asp:ListItem Value="10">10 ימים</asp:ListItem>
                <asp:ListItem Value="11">11 ימים</asp:ListItem>
                <asp:ListItem Value="12">12 ימים</asp:ListItem>
                <asp:ListItem Value="13">13 ימים</asp:ListItem>
                <asp:ListItem Value="14">14 ימים</asp:ListItem>
                <asp:ListItem Value="15">15 ימים</asp:ListItem>
                <asp:ListItem Value="16">16 ימים</asp:ListItem>
                <asp:ListItem Value="17">17 ימים</asp:ListItem>
                <asp:ListItem Value="18">18 ימים</asp:ListItem>
                <asp:ListItem Value="19">19 ימים</asp:ListItem>
                <asp:ListItem Value="20">20 ימים</asp:ListItem>
            </asp:DropDownList>
            <br /><br />
            <asp:DropDownList ID="Report4YNDDL" runat="server" AutoPostBack="true" OnSelectedIndexChanged="UpdateReport4">
                <asp:ListItem Text="Not including NO" Selected="True" Value="1"></asp:ListItem>
                <asp:ListItem Text="Including NO" Value="2"></asp:ListItem>
            </asp:DropDownList>
            <br /><br />
            <asp:ImageButton ID="ExportToExcel4" runat="server" ImageUrl="~/Images/excel.gif" OnClick="ExportToExcel" />
            
            </div>
            <asp:UpdateProgress ID="Report4UpdateProgress" runat="server" AssociatedUpdatePanelID="Report4Updatepanel">
            <ProgressTemplate>
                <asp:Label ID="Report4ProgresLabel" runat="server" Text="Loading..." CssClass="InerTextStyle"></asp:Label>
            </ProgressTemplate>
            </asp:UpdateProgress>
        </td>
        <td style="width:85%;">
            <div class="InerTextStyle">
            <asp:GridView ID="Report4GridView" runat="server" AutoGenerateColumns="false" AllowPaging="false" DataSourceID="Report4DataSource">
            <Columns>
                <asp:BoundField DataField="CustomerWorkOrderNumber" HeaderText="Work order number" 
                 HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%"/>
                <asp:BoundField DataField="ContractorWorkOrderNumber" HeaderText="Contractor Order Number" 
                 HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%"/>
                <asp:BoundField DataField="CustomerCatalougeCode" HeaderText="Customer catalogue code" 
                HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%" />
                <asp:TemplateField HeaderText="Time In Station" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                <ItemTemplate>
                <%# CalculateTimeSince(Eval("DateFieldB"))%>
                </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Days overdue" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                <ItemTemplate>
                <%# CalculateOverdueTime(Eval("DateFieldB"), "4")%>
                </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Send Date" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                <ItemTemplate>
                <%# FormatDate(Eval("SendDate")) %>
                </ItemTemplate>        
                       
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Requested delivery date" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                <ItemTemplate>
                <%# FormatDate(Eval("RequestedDelivaryDate"))%>
                </ItemTemplate>                
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Planned delivery date" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                <ItemTemplate>
                <%# FormatDate(Eval("PlannedDelivaryDate"))%>
                </ItemTemplate>                
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Actual delivery date" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                <ItemTemplate>
                <%# FormatDate(Eval("ActualDelivaryDate"))%>
                </ItemTemplate>                
                </asp:TemplateField>
                
                <asp:BoundField DataField="OrderNumber" HeaderText="Contractor order number" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%" />
                <asp:BoundField DataField="TextFieldA" HeaderText="Customer Service Manager" 
                HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%" />
                <asp:BoundField DataField="TextFieldB" HeaderText="$"
                 HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%" />
                 <asp:BoundField DataField="TextFieldC" HeaderText="<%$ Dict:TextFieldC %>" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%"  />
                
                <asp:TemplateField HeaderText="Supplier Approval" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%">
                <ItemTemplate>
                <%# FormatDate(Eval("DateFieldA"))%>
                </ItemTemplate>                
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Customer Approval" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%">
                <ItemTemplate>
                <%# FormatDate(Eval("DateFieldB"))%>
                </ItemTemplate>
                </asp:TemplateField>                
            </Columns>
            </asp:GridView>
            </div>
        </td>
        </tr>  
        </table>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="ExportToExcel4" />
        </Triggers>
        </asp:UpdatePanel> 
        <br />
        <br />
        <asp:UpdatePanel ID="DebatePanel" runat="server" UpdateMode="Conditional">
        <Triggers>
            <asp:PostBackTrigger ControlID="ExportToExcelDebate" />
        </Triggers>
        <ContentTemplate>
            <table>
            <tr>
            <td>
                <div  style="direction:rtl;">
                    <asp:Label ID="DebateTitlelabel" runat="server" Text="הזמנות במחלוקת" CssClass="TitleStyle"></asp:Label>
                </div>
                <asp:ImageButton ID="ExportToExcelDebate" runat="server" ImageUrl="~/Images/excel.gif" OnClick="ExportToExcel" />
            </td>
            <td>
                <div class="InerTextStyle">
                <asp:GridView ID="DebateGridview" runat="server" AutoGenerateColumns="false" AllowPaging="false" DataSourceID="DebateReportDataSource">
                <Columns>
                    <asp:BoundField DataField="CustomerWorkOrderNumber" HeaderText="Work order number" 
                     HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%"/>
                    <asp:BoundField DataField="ContractorWorkOrderNumber" HeaderText="Contractor Order Number" 
                     HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%"/>
                    <asp:BoundField DataField="CustomerCatalougeCode" HeaderText="Customer catalogue code" 
                    HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="21%" />
                    <%--<asp:TemplateField HeaderText="Time In Station" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                    <ItemTemplate>
                    
                    </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Days overdue" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                    <ItemTemplate>
                    
                    </ItemTemplate>
                    </asp:TemplateField>--%>
                    <asp:TemplateField HeaderText="Send Date" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                    <ItemTemplate>
                    <%# FormatDate(Eval("SendDate")) %>
                    </ItemTemplate>        
                           
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Requested delivery date" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                    <ItemTemplate>
                    <%# FormatDate(Eval("RequestedDelivaryDate"))%>
                    </ItemTemplate>                
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderText="Planned delivery date" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                    <ItemTemplate>
                    <%# FormatDate(Eval("PlannedDelivaryDate"))%>
                    </ItemTemplate>                
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderText="Actual delivery date" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%">
                    <ItemTemplate>
                    <%# FormatDate(Eval("ActualDelivaryDate"))%>
                    </ItemTemplate>                
                    </asp:TemplateField>
                    
                    <asp:BoundField DataField="OrderNumber" HeaderText="Contractor order number" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="7%" />
                    <asp:BoundField DataField="TextFieldA" HeaderText="Customer Service Manager" 
                    HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%" />
                    <asp:BoundField DataField="TextFieldB" HeaderText="$"
                     HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%" />
                     <asp:BoundField DataField="TextFieldC" HeaderText="<%$ Dict:TextFieldC %>" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%"  />
                    
                    <asp:TemplateField HeaderText="Supplier Approval" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%">
                    <ItemTemplate>
                    <%# FormatDate(Eval("DateFieldA"))%>
                    </ItemTemplate>                
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderText="Customer Approval" HeaderStyle-BackColor="#86C2FF" ItemStyle-Width="6%">
                    <ItemTemplate>
                    <%# FormatDate(Eval("DateFieldB"))%>
                    </ItemTemplate>
                    </asp:TemplateField>                
                </Columns>
                </asp:GridView>
                </div>
            </td>
            </tr>
            
            </table>
        </ContentTemplate>
        </asp:UpdatePanel>
        
         <asp:SqlDataSource ID="Report1DataSource" runat="server" ConnectionString="<%$ ConnectionStrings:MLYConnectionString %>" SelectCommandType="Text"></asp:SqlDataSource>   
         <asp:SqlDataSource ID="Report2DataSource" runat="server" ConnectionString="<%$ ConnectionStrings:MLYConnectionString %>" SelectCommandType="Text"></asp:SqlDataSource>   
         <asp:SqlDataSource ID="Report3DataSource" runat="server" ConnectionString="<%$ ConnectionStrings:MLYConnectionString %>" SelectCommandType="Text"></asp:SqlDataSource>   
         <asp:SqlDataSource ID="Report4DataSource" runat="server" ConnectionString="<%$ ConnectionStrings:MLYConnectionString %>" SelectCommandType="Text"></asp:SqlDataSource>   
         <asp:SqlDataSource ID="DebateReportDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:MLYConnectionString %>" SelectCommandType="Text"></asp:SqlDataSource>
    </div>
    </form>
</body>
</html>
